package com.hunnyovo.springframework.beans.factory.support;

import com.hunnyovo.springframework.beans.BeansException;
import com.hunnyovo.springframework.beans.factory.config.BeanDefinition;

import java.lang.reflect.Constructor;

/**
 * 实例化bean策略接口
 *
 * @author Create By Cb
 * @date 2022/10/26 18:36
 **/
public interface InstantiationStrategy {

    /**
     * 实例化bean
     *
     * @param beanDefinition:
     * @param beanName:
     * @param constructor:
     * @param args:
     * @return {@link Object}
     * @author Create By Cb
     * @date 2022/11/18 16:55
     */
    Object instantiation(BeanDefinition beanDefinition, String beanName, Constructor<?> constructor, Object... args) throws BeansException;

}
